<?php
class User extends Doctrine_Record
{
    public function setTableDefinition()
    {
        $this->hasColumn('company_id', 'integer', 20);
        $this->hasColumn('username', 'string', 255);
        $this->hasColumn('password', 'string', 255);
        $this->hasColumn('company', 'string', 255);
        $this->hasColumn('name', 'string', 255);
        $this->hasColumn('surname', 'string', 255);
        $this->hasColumn('jobtitle', 'string', 255);
        $this->hasColumn('userlevel', 'integer', 1);
        $this->hasColumn('email', 'string', 255);
        $this->hasColumn('psl', 'integer', 3);
        $this->hasColumn('active', 'integer', 1);
        $this->hasColumn('sentemail', 'integer', 1);
        $this->hasColumn('apklausa', 'string', 255);
        $this->hasColumn('rights', 'string', 1000);
    }
    public function setUp()
    {
       $this->actAs('Timestampable');
        $this->hasOne('Comment', array(
                'local' => 'id',
                'foreign' => 'user_id'
            )
        );
         $this->hasMany('Support', array(
                'local' => 'id',
                'foreign' => 'set_job_user_id'
            )
        );
         $this->hasMany('Act as Acts', array(
                'local' => 'id',
                'foreign' => 'user_id'
            )
        );
         $this->hasOne('Company', array(
                'local' => 'company_id',
                'foreign' => 'id'
            )
        );
    }

}


